<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:ui="http://java.sun.com/jsf/facelets"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">  
    <h:outputStylesheet library="css" name="main.css" />  
    <h:body>  
        <ui:composition template="WEB-INF/facelets/template.xhtml">  
            <ui:param name="title" value="Add product"/>
            <ui:define name="content">  
                <h:form>
                    <div id="mainbox">
                        <div id="addPanel">  
                            <div id="addTable">

                            
                            <div class="addTable">
                            <div id="row1">
                                <div id="l1" class="leftCol">
                                    <h:outputLabel for="name" value="Name:"/>
                                </div>
                                <div id="r1" class="rightCol">
                                    <p:inputText id="name" value="#{addProductControllerBean.name}" />
                                </div>
                            </div></div><br/>
                            <div id="msgRow"><p:panel id="msgName" styleClass="msgPanel"><p:message for="name" display="text"/></p:panel></div><br/>
                            <div class="addTable">
                            <div id="row2">
                                <div id="l2" class="leftCol">
                                    <h:outputLabel for="category" value="Category:"/>
                                </div>
                                <div id="r2" class="rightCol">
                                    <p:inputText id="category" value="#{addProductControllerBean.cat}" />
                                </div>
                            </div></div><br/><br/>
                            <br/><br/>
                            <div class="addTable">
                            <div id="row3">
                                <div id="l3" class="leftCol">
                                    <h:outputLabel for="price" value="Price:"/>
                                </div>
                                <div id="r3" class="rightCol">
                                    <p:inputText id="price" value="#{addProductControllerBean.price}" />
                                </div>
                            </div></div><br/><br/>
                            <div class="msgRow"><p:panel id="msgPrice" styleClass="msgPanel"><p:message for="price" display="text"/></p:panel></div>
                        </div></div>
                    <br/>
                    <p:commandButton ajax="true" value="Add Product" action="#{addProductControllerBean.doAddProduct}" update="msgPrice, msgName"/><br/>
                    
                    </div>
                </h:form>
            </ui:define>  
        </ui:composition>  
    </h:body>  
</html>  
